#include "reservation.h"

using namespace aviation;
using namespace std;

Reservation::Reservation()
: m_reservationStatus(STANDARD_CLASS)
{
}

Reservation::Reservation(const Flight& flight, const Customer& customer, const RESERVATION_STATUS reservationStatus)
	: 
m_flightID(flight.GetID()),
m_customerID(customer.GetID()),
m_reservationStatus(reservationStatus)
{
}

Reservation::Reservation(const Reservation& other)
{
	*this = other;
}

Reservation::~Reservation()
{
}

Reservation& Reservation::operator=(const Reservation& other)
{
	m_flightID = other.m_flightID;
	m_customerID = other.m_customerID;
	m_reservationStatus = other.m_reservationStatus;

	return *this;
}

const bool Reservation::operator==(const Reservation& other) const
{
	return m_flightID == other.m_flightID 
		&& m_customerID == other.m_customerID 
		&& m_reservationStatus == other.m_reservationStatus;
}

const bool Reservation::operator!=(const Reservation& other) const
{
	return !(*this == other);
}

const bool Reservation::operator<(const Reservation& other) const
{
	return m_flightID < other.m_flightID || 
		(m_flightID == other.m_flightID && m_customerID < other.m_customerID);
}

const unsigned Reservation::GetFlightID() const
{
	return m_flightID;
}

const unsigned Reservation::GetCustomerID() const
{
	return m_customerID;
}

const Reservation::RESERVATION_STATUS Reservation::GetReservationStatus() const
{
	return (RESERVATION_STATUS)m_reservationStatus;
}